/*
 * DynamicArithmeticDescompresor.h
 *
 *  Created on: 01/12/2009
 *      Author: hernan
 */

#ifndef DYNAMICARITHMETICDESCOMPRESOR_H_
#define DYNAMICARITHMETICDESCOMPRESOR_H_

#include "../ArithmeticCompresor.h"

#include "ContextTable.h"
#include "../../CompresorUtil.h"
#include "BitManager.h"
#include "math.h"


class DynamicArithmeticDescompresor: public ArithmeticCompresor {

	public:	DynamicArithmeticDescompresor();

	public: virtual ~DynamicArithmeticDescompresor();

	private: string stringToUncompress;

	public: ContextTable *contextTable;

	public: CompresorUtil compresorUtil;

	public: BitManager* bitManager;

	static const int intervalSize = 256;

	public: unsigned int Floor;

	public: unsigned int roof;

	public: virtual string doUncompress();

	public: unsigned int getFloor() const;

	public: unsigned int getRoof() const;

	public: void setFloor(unsigned int floor);

	public: void setRoof(unsigned int roof);

	public: ContextTable* getContextTable() const;

	public: void setBitManager(BitManager* bitManager);

	public: BitManager* getBitManager() const;

	string getStringToUncompress() const;

	void setStringToUncompress(string stringToUncompress);

	char getRoofByNumber(unsigned int number, char contexto, unsigned int length);


};

#endif /* DYNAMICARITHMETICDESCOMPRESOR_H_ */
